<template>
<component :is="role" />

</template>

<script>
import TeacherHomeView from './TeacherHomeView.vue';
import StudentHomeView from './StudentHomeView.vue';

export default {
    name: 'HomeView',
    comments:{
        TeacherHomeView,StudentHomeView
    },
    data(){
        return {
            

        }
    },
    computed: {
        role(){
            console.log(this.$store.getters);
            let roleName = this.$store.getters.roles[0]
            console.log(this.$store.getters.username)
            console.log(roleName);
            if('teacher' === roleName || 'OutSchooler' === roleName){
                console.log('教师端')
                return  TeacherHomeView;

            }else{
                console.log('学生端');
                return StudentHomeView;
            }
        }
    },
    mounted(){

    },
    methods:{

    }
    
}

</script>